FROM ubuntu:24.04
RUN apt-get update
RUN apt-get upgrade --assume-yes
ENV DEBIAN_FRONTEND=noninteractive
 
RUN apt-get   install  --assume-yes python3-pip python3-sphinx adduser  build-essential git 
# Add the user test and passwd 1.
ARG user=test
RUN useradd --create-home --no-log-init --shell /bin/bash ${user} \
    && adduser ${user} sudo \
    && echo "${user}:1" | chpasswd


RUN mv /usr/lib/python3.12/EXTERNALLY-MANAGED   /usr/lib/python3.12/EXTERNALLY-MANAGED.bk

WORKDIR /home/test/app

COPY requirements.txt /home/test/app


RUN  pip3 install -r requirements.txt

RUN update-alternatives --install /usr/bin/python  python /usr/bin/python3  3600


USER  ${user}


